// import 'core-js'
import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter as Router, Switch } from 'react-router-dom'
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import store, { persistor } from '@/store'
import FrontendAuth from './frontendAuth.js'
import '@/style/index.css'

const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('@/assets/icons', false, /\.svg$/)
requireAll(req)

ReactDOM.render(
	<React.Suspense fallback={ <div></div> }>
		<Provider store={ store }>
			<PersistGate loading={ null } persistor={ persistor }>
				<Router basename="/react-admin-template">
					<Switch>
						<FrontendAuth />
					</Switch>
				</Router>
			</PersistGate>
		</Provider>
	</React.Suspense>,
	document.getElementById('app')
)